<?php

class TopicsController extends AppController{

	var $scaffold;

	function beforeFilter() {

		$this->Auth->allow('displayMasthead', 'displayFooter', 'displayIntro');
		parent::beforeFilter();
	}

	function displayMasthead($sCurrent = null){

		$sFilter = " nOrder > 0 && display_slot_id = 'masthead' ";
		$sOrder = " nOrder ASC ";
		$this->set('aData', $this->Topic->findAll($sFilter, null, $sOrder));
		$this->set('pathRoot','/cake/controller/index/'); // refactor!!
		$this->set('sCurrent', $sCurrent);
	}

	function displayFooter($sCurrent = null){

		$sFilter = " nOrder > 0  && display_slot_id = 'footer' ";
		$sOrder = " nOrder ASC ";
		$this->set('aData', $this->Topic->findAll($sFilter, null, $sOrder));
		$this->set('pathRoot','/cake/controller/index/'); // refactor!!
		$this->set('sCurrent', $sCurrent);
	}


	function displayIntro($sTopic){

		$sFilter = " Topic.id = '$sTopic' ";
		$this->set('aContent', $this->Topic->find($sFilter));
	}

}
?>


